package com.iwhalecloud.bss.kite.cucc.service.attr.linkhandler;

import com.iwhalecloud.bss.kite.common.constant.KeyConsts;
import com.iwhalecloud.bss.kite.common.util.KiteStringUtils;
import com.iwhalecloud.bss.kite.cucc.service.attr.AttrModifyHelper;
import com.iwhalecloud.bss.kite.cucc.service.attr.LocalAttrHelper;
import com.iwhalecloud.bss.kite.cucc.service.attr.handler.BandwidthBusinessModelHandler;
import com.iwhalecloud.bss.kite.listener.handler.attr.annotation.AttrHandler;
import com.iwhalecloud.bss.kite.listener.handler.attr.impl.AbstractAttrLinkageHandler;
import com.iwhalecloud.bss.kite.manager.inst.KiteAttr;
import com.iwhalecloud.bss.kite.manager.inst.KiteInst;
import com.iwhalecloud.bss.kite.service.attr.AttrData;
import org.springframework.stereotype.Service;

/**
 * @author 付喆
 * @version 2021/5/28 11:21
 * Description:
 */
@Service
@AttrHandler(BandwidthBusinessModelHandler.class)
public class BandwidthBusinessModelLinkHandler extends AbstractAttrLinkageHandler<AttrData> {
    @Override
    public void handle(KiteAttr kiteAttr, KiteInst kiteInst, AttrData attrData) {
        //固定带宽
        if(KiteStringUtils.equals(kiteAttr.getValue(), "110007226")){
            kiteInst.getAttr("210004224").setShowType(KeyConsts.PROD_ATTR_SHOW_TYPE_D);
            kiteInst.getAttr("200001818").setShowType(KeyConsts.PROD_ATTR_SHOW_TYPE_E);
        }else if(KiteStringUtils.equals(kiteAttr.getValue(), "110007227")){
            //可变带宽
            kiteInst.getAttr("200001818").setShowType(KeyConsts.PROD_ATTR_SHOW_TYPE_D);
            kiteInst.getAttr("210004224").setShowType(KeyConsts.PROD_ATTR_SHOW_TYPE_E);
        }
    }

    @Override
    public void handleStyle(KiteAttr kiteAttr, KiteInst kiteInst, AttrData attrData) {

    }
}
